package com.gitee.srurl.core.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gitee.srurl.core.domain.SucUrlRecordDomain;
import com.gitee.srurl.core.dto.RefreshRemainRecordDTO;
import com.gitee.srurl.core.dto.result.ShortUrlResultDTO;
import com.gitee.srurl.core.util.PageQuery;

import java.util.List;

/**
 * @author zxw
 * @date 2023/4/29 13:49
 */
public interface ISucUrlRecordService extends IService<SucUrlRecordDomain> {
    IPage<SucUrlRecordDomain> getList(PageQuery pageQuery, SucUrlRecordDomain urlRecordDomain);

    void add(SucUrlRecordDomain urlRecordDomain, ShortUrlResultDTO shortUrl);

    void updateUrlRecord(SucUrlRecordDomain urlRecordDomain, ShortUrlResultDTO shortUrl);

    void disabledOrActive(Long id);

    /**
     * 获取最近一天有访问记录的数据（非无限制次数）
     */
    List<SucUrlRecordDomain> getRecentOneDayHadVisitRecordNonUnlimited();

    /**
     * 刷新可访问次数
     *
     * @param refreshRemainRecordDTOList 需要刷新的列表
     */
    void refreshRecordRemainTimes(List<RefreshRemainRecordDTO> refreshRemainRecordDTOList);
}
